
package net.muhu.domain;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.jvnet.jaxb2_commons.lang.Equals;
import org.jvnet.jaxb2_commons.lang.HashCode;
import org.jvnet.jaxb2_commons.lang.ToString;
import org.jvnet.jaxb2_commons.lang.builder.JAXBEqualsBuilder;
import org.jvnet.jaxb2_commons.lang.builder.JAXBHashCodeBuilder;
import org.jvnet.jaxb2_commons.lang.builder.JAXBToStringBuilder;


/**
 * <p>Java class for Stage complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="Stage">
 *   &lt;complexContent>
 *     &lt;extension base="{urn:net:muhu:domain}Location">
 *       &lt;sequence>
 *         &lt;element name="monster" type="{urn:net:muhu:domain}SoundMonster" maxOccurs="unbounded" minOccurs="0"/>
 *       &lt;/sequence>
 *     &lt;/extension>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Stage", propOrder = {
    "monster"
})
public class Stage
    extends Location
    implements Equals, HashCode, ToString
{

    protected List<SoundMonster> monster;

    /**
     * Gets the value of the monster property.
     * 
     * <p>
     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a <CODE>set</CODE> method for the monster property.
     * 
     * <p>
     * For example, to add a new item, do as follows:
     * <pre>
     *    getMonster().add(newItem);
     * </pre>
     * 
     * 
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {@link SoundMonster }
     * 
     * 
     */
    public List<SoundMonster> getMonster() {
        if (monster == null) {
            monster = new ArrayList<SoundMonster>();
        }
        return this.monster;
    }

    public void equals(Object object, EqualsBuilder equalsBuilder) {
        if (!(object instanceof Stage)) {
            equalsBuilder.appendSuper(false);
            return ;
        }
        if (this == object) {
            return ;
        }
        super.equals(object, equalsBuilder);
        final Stage that = ((Stage) object);
        equalsBuilder.append(this.getMonster(), that.getMonster());
    }

    public boolean equals(Object object) {
        if (!(object instanceof Stage)) {
            return false;
        }
        if (this == object) {
            return true;
        }
        final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder();
        equals(object, equalsBuilder);
        return equalsBuilder.isEquals();
    }

    public void toString(ToStringBuilder toStringBuilder) {
        super.toString(toStringBuilder);
        {
            List<SoundMonster> theMonster;
            theMonster = this.getMonster();
            toStringBuilder.append("monster", theMonster);
        }
    }

    public String toString() {
        final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this);
        toString(toStringBuilder);
        return toStringBuilder.toString();
    }

    public void hashCode(HashCodeBuilder hashCodeBuilder) {
        super.hashCode(hashCodeBuilder);
        hashCodeBuilder.append(this.getMonster());
    }

    public int hashCode() {
        final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder();
        hashCode(hashCodeBuilder);
        return hashCodeBuilder.toHashCode();
    }

    public Stage withMonster(SoundMonster... values) {
        for (SoundMonster value: values) {
            getMonster().add(value);
        }
        return this;
    }

}
